package com.amir.common.beans

import com.amir.common.utils.Constant
import com.amir.common.utils.SPUtils
import com.google.gson.annotations.SerializedName
import java.io.Serializable


data class LoginDataEntity(
    val code: String,
    val state: String,
    val AccountId: String,
    val AccountName: String,
    val NonceStr: String,
    val EncodePassword: String,
    val sessionid: String
): Serializable

data class LoginEntity(
    val AccountId: Int,
    val code: String,
    val sessionid: String,
    val state: String,
    val data: LoginDataEntity?
) : BaseResult() {

    fun save() {
        SPUtils.save(Constant.code, this.code)
        SPUtils.save(Constant.accountid, this.data?.AccountId ?: 0)
        SPUtils.save(Constant.accountName, this.data?.AccountName ?: "")
        SPUtils.save(Constant.nonceStr, this.data?.NonceStr?: "")
        SPUtils.save(Constant.encodePassword, this.data?.EncodePassword?:"")
    }
}
// 注销接口返回结果实体
data class LogOffResult(
    @SerializedName("MsgCode") val msgCode: Int, // 状态码：0表示成功
    @SerializedName("ErrMsg") val errMsg: String?
)